package com.order.service.impl;

import com.order.dao.Cart;
import com.order.mapper.CartMapper;
import com.order.service.CartService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
@AllArgsConstructor
public class CartServiceImpl implements CartService {
    private CartMapper cartMapper;
    @Override
    public int addCart(Cart cart) {
        return cartMapper.addCart(cart);
    }

    @Override
    public int updateCart(Cart cart) {
        return cartMapper.updateCart(cart);
    }

    @Override
    public int deleteCart(int desk_id) {
        return cartMapper.deleteCart(desk_id);
    }

    @Override
    public int deleteCartById(int id) {
        return cartMapper.deleteCartById(id);
    }

    @Override
    public Cart getById(int id) {
        return cartMapper.getById(id);
    }

    @Override
    public int judgeExit(Map<String, Object> map) {
        return cartMapper.judgeExit(map);
    }

    @Override
    public Cart getCart(Map<String, Object> map) {
        return cartMapper.getCart(map);
    }

    @Override
    public List<Cart> getCarts(int desk_id) {
        return cartMapper.getCarts(desk_id);
    }
}
